package acm.浙江24赛;

import java.util.Scanner;

public class 痴呆帮 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while (t-- > 0) {
            int n = sc.nextInt();
            System.out.println(dp(n));
        }
    }

    static long[] dp;
    static final long mod = 998244353;


    public static long dp(int n) {
        if (n < 3) {
            return 1;
        }
        long[] dp = new long[n + 1];
        dp[0] = 1;
        dp[1] = 1;
        dp[2] = 1;
        for (int i = 3; i <= n; i++) {
            int m = (i - 1) >> 1;
            for (int j = 0; j <= m; j++) {
                dp[i] += dp[j] * dp[i - j - 1] % mod;
                dp[i] %= mod;
            }
        }
        return dp[n];
    }

    public static long dfs(int n) {
        if (dp[n] != 0) {
            return dp[n];
        }
        n--;
        int m = n >> 1;
        long res = 0;
        for (int i = 0; i <= m; i++) {
            long l = dfs(i);
            long r = dfs(n - i);
            res += l * r % mod;
            res %= mod;
        }
        dp[n + 1] = res % mod;
        return dp[n + 1];
    }
}
